#include<bits/stdc++.h>
using namespace std;
signed main() {

    int beginRow = 0, cnt = 0, row = 0;
    while(1) {
        row++;

        string s;
        getline(cin, s);

        if(s == ".")	break;

        if(s.find("chi1 huo3 guo1") != string::npos) {
            if(!beginRow)
                beginRow = row;
            cnt++;
        }
    }

    cout << row - 1 << "\n";
    if(!beginRow)
        cout << "-_-#";
    else
        cout << beginRow << " " << cnt;

    return 0;
}

